home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / picture / segment.h < prev    next >
Text File  |  1993-09-23  |  1KB  |  55 lines

  1. //    Copyright 1993 Ralph Gonzalez
  2.  
  3. /*
  4. *    FILE:        segment.h
  5. *    AUTHOR:        R. Gonzalez
  6. *    CREATED:    October 2, 1990
  7. *
  8. *    Defines general-purpose segment and nested segments for picture
  9. *    application.  All graphics figures descend from Segment.
  10. */
  11.  
  12. # ifndef    segment_h
  13. # define    segment_h
  14.  
  15. # include    "class.h"
  16. # include    "trans.h"
  17. # include    "camera.h"
  18. # include    "project.h"
  19. # include    "color.h"
  20.  
  21. # define    MAX_SEGMENTS    50
  22.  
  23. /******************************************************************
  24. *   abstract segment
  25. ******************************************************************/
  26. class    Segment:public Generic_Class
  27. {
  28. public:
  29.     virtual void    set_color(color);
  30.     virtual void    draw(Camera*,Projector*,Transformation*);
  31.     virtual void    move(Transformation*);
  32. };
  33.  
  34. /******************************************************************
  35. *   abstract nested segment
  36. ******************************************************************/
  37. class    Nested_Segment:public Segment
  38. {
  39. private:
  40.     Transformation    *transformation;
  41.     
  42. protected:
  43.     Segment            *segment[MAX_SEGMENTS];
  44.     int                num_segments;
  45.     
  46. public:
  47.     Nested_Segment(void);
  48.     virtual void    set_color(color);
  49.     virtual void    draw(Camera*,Projector*,Transformation*);
  50.     virtual void    move(Transformation*);
  51.     virtual            ~Nested_Segment(void);
  52. };
  53.  
  54. # endif
  55.